
*Panel B of Table 9

gen treat_young=bartik_standardized*(age44<=25)


gen treat_young_hs=bartikhs_st*(age44<=25)
gen treat_young_ls=bartikls_st*(age44<=25)



reghdfe higher_occ treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local controls "\checkmark"
estadd local controls2 "\checkmark"
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local established "Yes"

estimates store hde1
sum higher_occ if vuosi==1970
estadd scalar ymean=r(mean)

preserve
replace treat_young=bartiknotimber_st*(age44>=5&age44<=25)
reghdfe higher_occ treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local controls "\checkmark"
estadd local controls2 "\checkmark"
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local established "No"


estimates store hde2
sum higher_occ if vuosi==1970
estadd scalar ymean=r(mean)
restore 

reghdfe higher_occ treat_young_hs treat_young_ls , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local controls "\checkmark"
estadd local controls2 "\checkmark"
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"


estadd local established "Yes"

estimates store hde3
sum higher_occ if vuosi==1970
estadd scalar ymean=r(mean)





*******************************

reghdfe wc_ex treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local controls "\checkmark"
estadd local controls2 ""
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local established "Yes"

estimates store de1
sum wc_ex if vuosi==1970
estadd scalar ymean=r(mean)

preserve
replace treat_young=bartiknotimber_st*(age44>=5&age44<=25)
reghdfe wc_ex treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g) cl(muni_g)
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local controls "\checkmark"
estadd local controls2 ""
estimates store de2
estadd local established "No"

sum wc_ex if vuosi==1970
estadd scalar ymean=r(mean)
restore 

reghdfe wc_ex treat_young_hs treat_young_ls , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local controls "\checkmark"
estadd local controls2 ""
estadd local established "Yes"

estimates store de3
sum wc_ex if vuosi==1970
estadd scalar ymean=r(mean)




*******************************

reghdfe production_work treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local controls "\checkmark"
estadd local controls2 ""
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local established "Yes"

estimates store production_work1
sum production_work if vuosi==1970
estadd scalar ymean=r(mean)

preserve
replace treat_young=bartiknotimber_st*(age44>=5&age44<=25)
reghdfe production_work treat_young , a(age44 age44#laani50 fem $municontrols_cohort muni_g) cl(muni_g)
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local controls "\checkmark"
estadd local controls2 ""
estimates store production_work2
estadd local established "No"

sum production_work if vuosi==1970
estadd scalar ymean=r(mean)
restore 

reghdfe production_work treat_young_hs treat_young_ls , a(age44 age44#laani50 fem $municontrols_cohort muni_g ) cl(muni_g)
estadd local mfe "\checkmark"
estadd local cfe "\checkmark"
estadd local controls "\checkmark"
estadd local controls2 ""
estadd local established "Yes"

estimates store production_work3
sum production_work if vuosi==1970
estadd scalar ymean=r(mean)


labe var treat_young "Exposure x Young"
labe var treat_young_hs "HS Exposure x Young"
labe var treat_young_ls "LS Exposure x Young"


esttab  production_work1 production_work2 production_work3 de1 de2 de3  hde1 hde2 hde3  ///
using "$temp\tables\TABLE_occu_young.tex", ///
mgroups( "Production" "White collar"   "Executive" , pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span}) ) ///
replace keep(treat_young treat_young_hs treat_young_ls) nonotes ///s
b(%9.3f) se(%9.3f)  stats(N ymean established mfe cfe , fmt(0 3) layout(@ @ @) ///
labels("N"  "Y mean" "Established"    "Muni FE"  "Cohort FE")) label star(* .1 ** .05 *** .01) nodepvars nomtitle




est clear


